package com.gocoolmall.order.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.gocoolmall.common.to.mq.SeckillOrderTo;
import com.gocoolmall.common.utils.PageUtils;
import com.gocoolmall.order.entity.OrderEntity;
import com.gocoolmall.order.vo.*;

import java.util.Map;
import java.util.concurrent.ExecutionException;

/**
 * 订单
 *
 * @author zhangxiaobo
 * @email 1926992064@qq.com
 * @date 2020-12-09 23:01:20
 */
public interface OrderService extends IService<OrderEntity> {

    PageUtils queryPage(Map<String, Object> params);

    /**
     * 订单确认页返回需要用的数据
     * @return
     */
    OrderConfirmVO confirmOrder() throws ExecutionException, InterruptedException;

    /**
     * 下单操作
     * @param orderSubmitVO
     * @return
     */
    SubmitOrderResponseVo submitOrder(OrderSubmitVO orderSubmitVO);

    /**
     * 根据订单号获取订单
     * @param orderSn
     * @return
     */
    OrderEntity getOrderStatus(String orderSn);

    /**
     * 关闭订单
     * @param entity
     */
    void closeOrder(OrderEntity entity);

    /**
     * 获取当前订单额支付信息
     * @param orderSn
     * @return
     */
    PayVo getOrderPay(String orderSn);

    PageUtils queryPageWithItem(Map<String, Object> params);

    /**
     * 处理支付宝返回的数据
     * @param vo
     * @return
     */
    String handlePayResult(PayAsyncVo vo);

    void createSeckillOrder(SeckillOrderTo entity);
}

